/**
 * 显示图片的面板
 */
Ext.define('YX.core.util.ImagePanel', {
	 extend : 'Ext.panel.Panel',
	 alternateClassName : ['YX.ImagePanel'],
	 layout : 'fit',
	 imgCmp : null,
	 initComponent : function() {
	  this.imgCmp = Ext.create('Ext.Img');

	  this.items = [this.imgCmp];
	  this.loadImage();

	  this.callParent();
	 },
	 loadImage : function() {
	  if (!Ext.isEmpty(this.fileId)) {
		 YX.ZbusRpc.request({
		    module : 'BasDownloadFtpFileService',
		    scope : this,
		    params : {
			   fileId : this.fileId
		    },
		    success : function(rsp) {
			   if (!Ext.isEmpty(rsp.fileData)) {
			    this.imgCmp.setSrc("data:image/png;base64," + rsp.fileData);
			   } else {
			    this.imgCmp.setSrc('');
			   }
		    }
		   });
	  }
	 }
  });